package cn.iocoder.yudao.module.team.dal.mysql.hotel;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.team.dal.dataobject.hotel.HotelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.team.controller.admin.hotel.vo.*;

/**
 * 团队—酒店管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HotelMapper extends BaseMapperX<HotelDO> {

    default PageResult<HotelDO> selectPage(HotelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HotelDO>()
                .likeIfPresent(HotelDO::getName, reqVO.getName())
                .eqIfPresent(HotelDO::getPhone, reqVO.getPhone())
                .likeIfPresent(HotelDO::getRoomName, reqVO.getRoomName())
                .eqIfPresent(HotelDO::getRoomType, reqVO.getRoomType())
                .eqIfPresent(HotelDO::getValue1, reqVO.getValue1())
                .eqIfPresent(HotelDO::getValue2, reqVO.getValue2())
                .eqIfPresent(HotelDO::getValue3, reqVO.getValue3())
                .eqIfPresent(HotelDO::getValue4, reqVO.getValue4())
                .betweenIfPresent(HotelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HotelDO::getId));
    }

}